package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Nakisa on 2016/11/10.
 */
@Entity
@Table(name = "wx_pay_option")
public class WxPayOption extends BaseEntity{
    /**
     * 企业支付用商户id
     */
    private String corpidMchID;
    private String appid;
    private String wxMchId;
    private String wxPayKey;
    private String certLocalPath;
    private String certPassword;
    private String parentAppid;
    private String isSubMch;

    @Basic
    @Column(name = "appid", nullable = false, length = 64)
    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    @Basic
    @Column(name = "wx_mchID", nullable = true, length = 64)
    public String getWxMchId() {
        return wxMchId;
    }

    public void setWxMchId(String wxMchId) {
        this.wxMchId = wxMchId;
    }

    @Basic
    @Column(name = "wx_pay_key", nullable = true, length = 64)
    public String getWxPayKey() {
        return wxPayKey;
    }

    public void setWxPayKey(String wxPayKey) {
        this.wxPayKey = wxPayKey;
    }

    @Basic
    @Column(name = "cert_local_path", nullable = true, length = 128)
    public String getCertLocalPath() {
        return certLocalPath;
    }

    public void setCertLocalPath(String certLocalPath) {
        this.certLocalPath = certLocalPath;
    }

    @Basic
    @Column(name = "cert_password", nullable = true, length = 128)
    public String getCertPassword() {
        return certPassword;
    }

    public void setCertPassword(String certPassword) {
        this.certPassword = certPassword;
    }

    @Basic
    @Column(name = "parent_appid", nullable = true, length = 64)
    public String getParentAppid() {
        return parentAppid;
    }

    public void setParentAppid(String parentAppid) {
        this.parentAppid = parentAppid;
    }

    @Basic
    @Column(name = "is_subMch", nullable = true, length = 2)
    public String getIsSubMch() {
        return isSubMch;
    }

    public void setIsSubMch(String isSubMch) {
        this.isSubMch = isSubMch;
    }
    @Basic
    @Column(name = "corpid_mchID", nullable = true, length = 64)
    public String getCorpidMchID() {
        return corpidMchID;
    }

    public void setCorpidMchID(String corpidMchID) {
        this.corpidMchID = corpidMchID;
    }




    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxPayOption that = (WxPayOption) o;

        if (appid != null ? !appid.equals(that.appid) : that.appid != null) return false;
        if (wxMchId != null ? !wxMchId.equals(that.wxMchId) : that.wxMchId != null) return false;
        if (wxPayKey != null ? !wxPayKey.equals(that.wxPayKey) : that.wxPayKey != null) return false;
        if (certLocalPath != null ? !certLocalPath.equals(that.certLocalPath) : that.certLocalPath != null)
            return false;
        if (certPassword != null ? !certPassword.equals(that.certPassword) : that.certPassword != null) return false;
        if (parentAppid != null ? !parentAppid.equals(that.parentAppid) : that.parentAppid != null) return false;
        if (isSubMch != null ? !isSubMch.equals(that.isSubMch) : that.isSubMch != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = appid != null ? appid.hashCode() : 0;
        result = 31 * result + (wxMchId != null ? wxMchId.hashCode() : 0);
        result = 31 * result + (wxPayKey != null ? wxPayKey.hashCode() : 0);
        result = 31 * result + (certLocalPath != null ? certLocalPath.hashCode() : 0);
        result = 31 * result + (certPassword != null ? certPassword.hashCode() : 0);
        result = 31 * result + (parentAppid != null ? parentAppid.hashCode() : 0);
        result = 31 * result + (isSubMch != null ? isSubMch.hashCode() : 0);
        return result;
    }
}
